public class Dog{
    public String name;
    public int age;

    public Dog(String name, int age){
        this.name = name;
        this.age = age;
    }

    public Dog(String name){
        this.name = name;
    }

    public Dog(int age){
        this.age = age;
    }

    public Dog(){
        this("黑子", 6);
        System.out.println();
    }

    public void bark(){
        System.out.println(name + "旺旺叫...");
    }
    public void sleep(){
        System.out.println(name + "睡觉觉...");
    }

    /*public void printDog(){
        System.out.println("姓名:" + this.name + ", 年龄:" + this.age);
    }*/

    @Override
    public String toString() {
        return "[" + "name:" + this.name + ", age:" + this.age + "]";
    }
}